/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Page2.java
 *
 * Created on 09-dic-2008, 17:33:52
 */

package dbapplication.UI;

import dbapplication.Integracion.Controlador;
/**
 *
 * @author Administrador
 */
public class Page2 extends javax.swing.JFrame {
    
    // Variables declaration
    String tipo = "Administrador";
    int proceso = 0;
    
    /** Creates new form Page2 */
// SOLO DE PRUEBA
    public Page2() {
        initComponents();
        if (tipo.equals("Administrador"))
        {
            jLabelEliminar.setVisible(true);
            jLabelInsertar.setVisible(true);
            jLabelModificar.setVisible(true);
        }
   
        jLabelProceso.setFont(new java.awt.Font("Berlin Sans FB", 2, 13)); // NOI18N
        jLabelProceso.setForeground(new java.awt.Color(102, 102, 102));
        jLabelProceso.setText("Seleccioné la Accion que desea realizar");
        jLabelProceso.setVisible(true);
    }

    /**
     * Constructor que define los procesos mostrados segun el tipo de USUARIO
     * @param tipo(Administrador, Empleado, Cliente)
     */
    public Page2(String tipo) {
        this.tipo = tipo;
        initComponents();

        this.setSize(480,450);
        this.setLocation(450, 200);
//        this.setIconImage(
//                new javax.swing.ImageIcon(getClass().getResource("/dbappication/Imagenes/Icono_Ventana.png")).getImage() );


         if (tipo.equals("Administrador"))
        {
            jLabelEliminar.setVisible(true);
            jLabelInsertar.setVisible(true);
            jLabelModificar.setVisible(true);
        }
   
        jLabelProceso.setFont(new java.awt.Font("Berlin Sans FB", 2, 13)); // NOI18N
        jLabelProceso.setForeground(new java.awt.Color(102, 102, 102));
        jLabelProceso.setText("Seleccioné la Accion que desea realizar");
        jLabelProceso.setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelConsultar = new javax.swing.JLabel();
        jLabelEliminar = new javax.swing.JLabel();
        jLabelInsertar = new javax.swing.JLabel();
        jLabelModificar = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabelTitulo = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabelClientes = new javax.swing.JLabel();
        jLabelEventos = new javax.swing.JLabel();
        jLabelProveedores = new javax.swing.JLabel();
        jLabelInventario = new javax.swing.JLabel();
        jLabelEmpleados = new javax.swing.JLabel();
        jButtonAtras = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabelProceso = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelConsultar.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 16)); // NOI18N
        jLabelConsultar.setText("Consultar");
        jLabelConsultar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelConsultarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelConsultarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelConsultarMouseExited(evt);
            }
        });

        jLabelEliminar.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 16));
        jLabelEliminar.setText("Eliminar");
        jLabelEliminar.setVisible(false);
        jLabelEliminar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelEliminarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelEliminarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelEliminarMouseExited(evt);
            }
        });

        jLabelInsertar.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 16)); // NOI18N
        jLabelInsertar.setText("Insertar");
        jLabelInsertar.setVisible(false);
        jLabelInsertar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelInsertarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelInsertarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelInsertarMouseExited(evt);
            }
        });

        jLabelModificar.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 16)); // NOI18N
        jLabelModificar.setText("Modificar");
        jLabelModificar.setVisible(false);
        jLabelModificar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelModificarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelModificarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelModificarMouseExited(evt);
            }
        });

        jLabelTitulo.setFont(new java.awt.Font("Berlin Sans FB", 0, 20)); // NOI18N
        jLabelTitulo.setText("Gestion de datos");

        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.PAGE_AXIS));

        jLabelClientes.setFont(new java.awt.Font("Berlin Sans FB", 0, 14));
        jLabelClientes.setText("Clientes");
        jLabelClientes.setVisible(false);
        jLabelClientes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelClientesMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelClientesMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelClientesMouseExited(evt);
            }
        });
        jPanel1.add(jLabelClientes);

        jLabelEventos.setFont(new java.awt.Font("Berlin Sans FB", 0, 14));
        jLabelEventos.setText("Eventos");
        jLabelEventos.setVisible(false);
        jLabelEventos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelEventosMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelEventosMouseExited(evt);
            }
        });
        jPanel1.add(jLabelEventos);

        jLabelProveedores.setFont(new java.awt.Font("Berlin Sans FB", 0, 14));
        jLabelProveedores.setText("Proveedores");
        jLabelProveedores.setVisible(false);
        jLabelProveedores.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelProveedoresMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelProveedoresMouseExited(evt);
            }
        });
        jPanel1.add(jLabelProveedores);

        jLabelInventario.setFont(new java.awt.Font("Berlin Sans FB", 0, 14)); // NOI18N
        jLabelInventario.setText("Inventario");
        jLabelInventario.setVisible(false);
        jLabelInventario.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelInventarioMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelInventarioMouseExited(evt);
            }
        });
        jPanel1.add(jLabelInventario);

        jLabelEmpleados.setFont(new java.awt.Font("Berlin Sans FB", 0, 14));
        jLabelEmpleados.setText("Empleados");
        jLabelEmpleados.setVisible(false);
        jLabelEmpleados.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelEmpleadosMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelEmpleadosMouseExited(evt);
            }
        });
        jPanel1.add(jLabelEmpleados);

        jButtonAtras.setText("Atrás");
        jButtonAtras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAtrasActionPerformed(evt);
            }
        });

        jPanel2.setLayout(new java.awt.GridLayout());

        jLabelProceso.setFont(new java.awt.Font("Berlin Sans FB", 2, 13)); // NOI18N
        jLabelProceso.setForeground(new java.awt.Color(102, 102, 102));
        jLabelProceso.setText("proceso");
        jLabelProceso.setVisible(false);
        jPanel2.add(jLabelProceso);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButtonAtras)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 262, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelTitulo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 184, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelEliminar)
                            .addComponent(jLabelConsultar)
                            .addComponent(jLabelInsertar)
                            .addComponent(jLabelModificar))
                        .addGap(36, 36, 36)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(129, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(jLabelTitulo)
                .addGap(35, 35, 35)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabelConsultar, javax.swing.GroupLayout.DEFAULT_SIZE, 21, Short.MAX_VALUE)
                        .addGap(23, 23, 23)
                        .addComponent(jLabelEliminar, javax.swing.GroupLayout.DEFAULT_SIZE, 21, Short.MAX_VALUE)
                        .addGap(22, 22, 22)
                        .addComponent(jLabelInsertar, javax.swing.GroupLayout.DEFAULT_SIZE, 21, Short.MAX_VALUE)
                        .addGap(26, 26, 26)
                        .addComponent(jLabelModificar, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                        .addGap(109, 109, 109)
                        .addComponent(jButtonAtras))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 4, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(30, 30, 30))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents




//************* Sombreado de los PROCESOS ***************\\

    private void jLabelConsultarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelConsultarMouseEntered
       jLabelConsultar.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelConsultarMouseEntered

    private void jLabelConsultarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelConsultarMouseExited
         jLabelConsultar.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelConsultarMouseExited

    private void jLabelEliminarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEliminarMouseEntered
        jLabelEliminar.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelEliminarMouseEntered

    private void jLabelEliminarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEliminarMouseExited
        jLabelEliminar.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelEliminarMouseExited

    private void jLabelInsertarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInsertarMouseEntered
        jLabelInsertar.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelInsertarMouseEntered

    private void jLabelInsertarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInsertarMouseExited
        jLabelInsertar.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelInsertarMouseExited

    private void jLabelModificarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelModificarMouseEntered
        jLabelModificar.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelModificarMouseEntered

    private void jLabelModificarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelModificarMouseExited
        jLabelModificar.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelModificarMouseExited




//***************** Clicks de los PROCESOS ******************\\

//CONSULTAR
    private void jLabelConsultarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelConsultarMouseClicked
      
      jLabelClientes.setVisible(true);
      jLabelProceso.setFont(new java.awt.Font("Berlin Sans FB", 0, 14)); // NOI18N
      jLabelProceso.setForeground(new java.awt.Color(0,0,0));
      jLabelProceso.setText("Consultar registro de:");
      proceso=0;

      if (tipo.equals("Empleado")||tipo.equals("Administrador"))
      {
           jLabelEventos.setVisible(true);
           jLabelInventario.setVisible(true);
           jLabelProveedores.setVisible(true);
      }

      if (tipo.equals("Administrador"))
          jLabelEmpleados.setVisible(true);

    }//GEN-LAST:event_jLabelConsultarMouseClicked

//ELIMINAR
    private void jLabelEliminarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEliminarMouseClicked
      jLabelProceso.setFont(new java.awt.Font("Berlin Sans FB", 0, 14)); // NOI18N
      jLabelProceso.setForeground(new java.awt.Color(0,0,0));
      jLabelProceso.setText("Eliminar registro de:");
      proceso=1;

      if (tipo.equals("Administrador"))
      {
         jLabelClientes.setVisible(true);
         jLabelEmpleados.setVisible(true);
         jLabelEventos.setVisible(true);
         jLabelInventario.setVisible(true);
         jLabelProveedores.setVisible(true);
      }
      else
      {
          // mesajito de proceso bloqueado
      }
    }//GEN-LAST:event_jLabelEliminarMouseClicked

//INSERTAR
    private void jLabelInsertarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInsertarMouseClicked
      jLabelProceso.setFont(new java.awt.Font("Berlin Sans FB", 0, 14)); // NOI18N
      jLabelProceso.setForeground(new java.awt.Color(0,0,0));
      jLabelProceso.setText("Insertar registro de:");
      proceso=2;

      jLabelClientes.setVisible(true);
      jLabelEmpleados.setVisible(true);
      jLabelEventos.setVisible(true);
      jLabelInventario.setVisible(true);
      jLabelProveedores.setVisible(true);
    }//GEN-LAST:event_jLabelInsertarMouseClicked

//MODIFICAR
    private void jLabelModificarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelModificarMouseClicked
      jLabelProceso.setFont(new java.awt.Font("Berlin Sans FB", 0, 14)); // NOI18N
      jLabelProceso.setForeground(new java.awt.Color(0,0,0));
      jLabelProceso.setText("Modificar registro de:");
      proceso=3;

      jLabelClientes.setVisible(true);
      jLabelEmpleados.setVisible(true);
      jLabelEventos.setVisible(true);
      jLabelInventario.setVisible(true);
      jLabelProveedores.setVisible(true);
    }//GEN-LAST:event_jLabelModificarMouseClicked

    
    
    
//************* Sombreado de las ENTIDADES *****************\\
    
    private void jLabelClientesMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelClientesMouseEntered
        jLabelClientes.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelClientesMouseEntered

    private void jLabelClientesMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelClientesMouseExited
       jLabelClientes.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelClientesMouseExited

    private void jLabelEventosMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEventosMouseEntered
        jLabelEventos.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelEventosMouseEntered

    private void jLabelProveedoresMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelProveedoresMouseExited
        jLabelProveedores.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelProveedoresMouseExited

    private void jLabelInventarioMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInventarioMouseEntered
        jLabelInventario.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelInventarioMouseEntered

    private void jLabelInventarioMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInventarioMouseExited
        jLabelInventario.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelInventarioMouseExited

    private void jLabelEmpleadosMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEmpleadosMouseEntered
        jLabelEmpleados.setForeground(new java.awt.Color(153,153,153));        // TODO add your handling code here:
    }//GEN-LAST:event_jLabelEmpleadosMouseEntered

    private void jLabelEmpleadosMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEmpleadosMouseExited
        jLabelEmpleados.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelEmpleadosMouseExited

    private void jLabelEventosMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEventosMouseExited
        jLabelEventos.setForeground(new java.awt.Color(0,0,0));
    }//GEN-LAST:event_jLabelEventosMouseExited

    private void jLabelProveedoresMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelProveedoresMouseEntered
        jLabelProveedores.setForeground(new java.awt.Color(153,153,153));
    }//GEN-LAST:event_jLabelProveedoresMouseEntered

    
    
    
//************* Clicks de las ENTIDADES *****************\\
    private void jLabelClientesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelClientesMouseClicked

         switch(proceso){
                   case 0:
                            //consultar
                            Controlador.cargarCientes();
                            break;
                   case 1:
                            //Eliminar
                            break;
                   case 2:
                            //Insertar
                            break;
                   case 3:
                            //Modificar
                            break;
           }
    }//GEN-LAST:event_jLabelClientesMouseClicked






    private void jButtonAtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAtrasActionPerformed
        this.setVisible(false);
    }//GEN-LAST:event_jButtonAtrasActionPerformed




    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Page2().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonAtras;
    private javax.swing.JLabel jLabelClientes;
    private javax.swing.JLabel jLabelConsultar;
    private javax.swing.JLabel jLabelEliminar;
    private javax.swing.JLabel jLabelEmpleados;
    private javax.swing.JLabel jLabelEventos;
    private javax.swing.JLabel jLabelInsertar;
    private javax.swing.JLabel jLabelInventario;
    private javax.swing.JLabel jLabelModificar;
    private javax.swing.JLabel jLabelProceso;
    private javax.swing.JLabel jLabelProveedores;
    private javax.swing.JLabel jLabelTitulo;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables

}
